package java_learn.java_jinjie.object;

import java.util.ArrayList;
import java.util.Collection;

public class DemoCollection {
    public static void main(String[] args) {
        Collection<String> coll = new ArrayList<String>();
        coll.add("1");
        coll.add("2");
        coll.add("3");
        System.out.println(coll);

        Boolean flag = coll.remove("1");
        System.out.println(flag);
        System.out.println(coll);
//        coll.clear();
        System.out.println(coll);

        boolean result = coll.contains("java");
        System.out.println(result);
        System.out.println(coll.isEmpty());
        Object[] arr = coll.toArray();
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
        }
    }
}
